## =========================================================
# Sample python site by ApOgEE
# ----------------------------
# 1) Make sure you have apache and enable mod-python on your apache. For example on ubuntu:
#    $ sudo apt-get install apache2
#    $ sudo apt-get install libapache2-mod-python
#    $ sudo a2enmod python
#
# 2) Make sure you have proper PythonHandler. For example:
# AddHandler mod_python .py
# PythonHandler mod_python.publisher
# PythonDebug On
#
# 3) Enter this codes and name it as 'pythonmysample.py' on your web directory
#
# 4) test it on your browser http://localhost/pythonmysample.py
#

def index(req):
    thetitle = "Python.my sample by ApOgEE"
    mysite = siteheader(thetitle)
    mysite += sitebody(thetitle)
    mysite += sitefoot()
    return mysite 

def siteheader(title):
    str = "<html><head><title>" + title + "\n"
    str += "</title></head><body>\n"
    return str

def sitefoot():
    str = "\n</body></html>"
    return str

def sitebody(title):
    str = "<h1>" + title + "</h1>\n"
    str += "<p>Hi mate!<br>\n" + \
           "This is the testing python site example.<br><br>" + \
    "Coded by: ApOgEE<br>" + \
    "Visit <a href=\"http://coderstalk.blogspot.com\">http://coderstalk.blogspot.com</a>\n"
    return str

# end of code. Copyright (C) 2009, ApOgEE - http://coderstalk.blogspot.com

